public class Test4 {
    public static void main(String[] args) {
        class Vehicle {
            protected String make;
            protected String model;

            public Vehicle(String make, String model) {
                this.make = make;
                this.model = model;
            }

            public void drive() {
                System.out.println("驾驶车辆");
            }
        }

        class Car extends Vehicle {
            public Car(String make, String model) {
                super(make, model);
            }

            @Override
            public void drive() {
                System.out.println("驾驶汽车 " + make + " " + model + "，使用方向盘操控");
            }
        }

        class Bike extends Vehicle {
            public Bike(String make, String model) {
                super(make, model);
            }

            @Override
            public void drive() {
                System.out.println("骑摩托车 " + make + " " + model + "，通过车把控制方向");
            }
        }

         class main {
            public static void main(String[] args) {
                Vehicle[] vehicles = new Vehicle[3];
                vehicles[0] = new Car("宝马", "X5");
                vehicles[1] = new Bike("哈雷", "883");
                vehicles[2] = new Car("奔驰", "C级");

                for (Vehicle vehicle : vehicles) {
                    vehicle.drive();
                }
            }
        }
    }

}
